﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DiscoveryLogic.Analytics.DataObjects;

namespace DiscoveryLogic.Analytics.Modules.Entities
{
	/// <summary>
	/// Interaction logic for PersonView.xaml
	/// </summary>
	public partial class PersonView : UserControl
	{
		private readonly PersonPresenter _Presenter;

		public PersonView()
		{
			InitializeComponent();
		}

		public PersonView(PersonPresenter presneter):this()
		{
			_Presenter = presneter;
			_Presenter.View = this;
            _Presenter.SubscribePersonSelectedEvent(null);
		    this.Person = null;
		}

		public PersonDO Person
		{
			set
			{
			    this.DataContext = value;
                if (value == null)
                {
                    this.Visibility = System.Windows.Visibility.Collapsed;
                }
                else
                {
                    this.Visibility = System.Windows.Visibility.Visible;
                }
			}
		}
	}
}
